package com.zjj.concurrent.forkjoin.util;

import java.math.BigInteger;

/**
 * @author zhanglei.zjj
 * @description TODO
 * @date 2023/6/4 22:22
 */
public class CalcUtil {
    public static BigInteger calculateFactorial (BigInteger input) {
        BigInteger factorial = BigInteger.ONE;
        for (BigInteger i = BigInteger.ONE;
             i.compareTo(input) <= 0;
             i = i.add(BigInteger.ONE)) {
            factorial = factorial.multiply(i);
        }
        return factorial;
    }
}
